<template>
  <div class="headerbox">
    <div class="headeruser">
      <div>
        <van-icon @click="$router.go(-1)" class="threeone" name="arrow-left" />
      </div>
      <div>
        <span>购物车</span>
      </div>
      <div><van-icon class="three" name="ellipsis" /></div>
    </div>

    <div class="wanthas">
      <span>可能你还想要</span>
    </div>

    <div class="car-box">
      <div
        v-for="item in list"
        :key="item.id"
        @click="$router.push('/detail' + item.id)"
        class="goods"
      >
        <img :src="item.imageHost + item.mainImage" alt="" />
        <p>{{ item.name }}</p>
        <i>￥ {{ item.price }}</i>
      </div>
    </div>
  </div>
</template>

<script>
import { getcarlist } from "../../../network/routerheader";
export default {
  created() {
    this.getlist();
  },
  data() {
    return {
      list: [],
      checked: "",
    };
  },
  methods: {
    async getlist() {
     const res= await this.$require({
        url:'/product/recommend',
        method:'get'
      })
      // console.log(res);
      if(res.status===200){
        this.list=res.data.data
        // console.log(this.list);
      }
    },
  },
};
</script>

<style lang="scss" scoped>
body {
  background-color: red;
}
.headeruser {
  width: 100%;
  height: 48px;
  display: flex;
  position: fixed;
  top: 0;
  z-index: 100;
  background-color: #f7f7f7;
  div {
    flex: 1;
    font-size: 18px;
    color: #000000;
    margin: 10px 0px;
    z-index: 99;
    .three {
      font-size: 26px;
      margin-left: 60px;
      font-weight: bold;
    }
    .threeone {
      font-weight: bold;
      font-size: 20px;
    }
    span {
      display: block;
      margin: 0px 35px;
    }
  }
}

.wanthas {
  width: 355px;
  line-height: 0px;
  position: relative;
  color: #969799;
  background-color: #fff;
  padding: 30px 10px;
  text-align: center;
  font-size: 14px;
}
.car-box {
 padding-bottom: 50px;
  div {
    width: 166px;
    height: 226px;
    padding: 10px;
    float: left;
    border: 0.1px solid #969799;
    padding-bottom: 0px;
    img {
      width: 166px;
      height: 145px;
    }
    p {
      padding: 0;
      margin: 0;
      color: #333333;
      font-size: 13px;
    }
    i {
      display: block;
      margin-left: 0;
      font-size: 16px;
      color: #f63515;
    }
  }
}
.buttom {
  width: 345px;
  height: 50px;
  padding: 0 16px;
  .van-radio {
    color: red;
  }
}
</style>